<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			background-image:url("img/bj.png");
		}
		.myh3{
			color:white;
		}
	</style>
</head>
<body>
	<%
		String code = request.getParameter("code");
		if("1001".equals(code)){
	%>  <h3 class="myh3">对不起，您的用户名和密码错误！</h3><% 
		}else if("1002".equals(code)){
	 %>  <h3 class="myh3">请先登录！</h3><% 
	 	}else if("1003".equals(code)){
	 %>  <h3 class="myh3">退出成功！</h3><% 
	 	}
	 %>
	 <span style="float:right;font-size:18px;margin:30px;color:white;"><a href="email.jspx">联系我们</a></span>
	<div class="container">
		<div class="row">
			<div class="well" style="margin:150px auto;width:450px;">
				<form id="myform" class="form-horizontal" action="login.jspx" method="post">
					
						<legend >用户登录</legend>
						<div class="control-group success " style="padding-left:40px;">
							<label for="input01" class="control-label" style="width:80px;color:#000;font-size:16px;font-family:微软雅黑;">用户名</label>
							<div class="controls" style="margin-left:110px;">
								<input type="text" id="username" name="username" style="width:160px;height:30px;font-size:16px;">
								<span id="username-erro"></span>
								<p class="help-block">用户名只能是英文或数字</p>
							</div>
						</div>
						
						<div class="control-group success" style="padding-left:40px;" >
							<label for="input01" class="control-label" style="width:80px;color:#000;font-size:16px;font-family:微软雅黑;">密&nbsp;&nbsp;码</label>
							<div class="controls" style="margin-left:110px;">
								<input type="password" id="password" name="password" style="width:160px;height:30px;font-size:16px;">
								<span id="pwd-erro"></span>
								<p class="help-block">密码必须为6~10位数字或字母</p>
							</div>
						</div>
						<div class="form-actions" >
							<button class="btn" type="reset" style="float:right">Cancel</button>
							<button type="button" id="btn" class="btn btn-primary span1" style="float:right;margin-right:30px;">登录</button>
							
						 </div>	
					
				</form>
				
			</div>
		</div>
	</div>
	<script type="text/javascript">
	
		$(document).ready(function(){
		
			$("#username").keydown(function(){
				$("#username-erro").html("");
			});
			$("#password").keydown(function(){
				$("#pwd-erro").html("");
			});
			$("#btn").click(function(){
				var name=$("#username").val();
				var pwd=$("#password").val();
				
				if(name.trim()==""){
					$("#username").focus();
					$("#username-erro").html("（用户名必填！）");
					return;
				}
				if(pwd==""){
					$("#password").focus();
					$("#pwd-erro").html("（密码必填！）");
					return;
				}
				$("#myform").submit();
			});
		});
	</script>
</body>
</html>